package com.lingkun.demo.sys.mapper;

import com.lingkun.demo.sys.entity.SysRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 小龙
 * @since 2021-04-24
 */
public interface SysRoleMapper extends BaseMapper<SysRole> {

    //用户id查询角色id
    @Select("select distinct role_id from user_role where user_id = #{id}")
    List<String> getRole(String id);

    //权限id查询角色id
    @Select("select distinct role_id from role_menu where menu_id = #{id}")
    List<String> getPermRole(String id);
}
